export function useGenYear (start: number, end : number) {
    // 生成年份
    const yearOps = ref<number[]>([]);
    const generateYears = () => {
        for (let i = start; i <= end; i++) {
            yearOps.value.push(i);
        };
    };
    return {
        yearOps,
        generateYears
    };
};

export function useGenMonth (start = 1, end = 12) {
    // 生成月份
    const monthOps = ref<number[]>([]);
    const generateMonths = () => {
        for (let i = start; i <= end; i++) {
            monthOps.value.push(i);
        };
    };
    return {
        monthOps,
        generateMonths
    };
};

export function useGenDay (year, month) {
    // 生成日期
    const dayOps = ref<number[]>([]);
    const generateDays = () => {
        const days = new Date(year, month, 0).getDate();
        for (let i = 1; i <= days; i++) {
            dayOps.value.push(i);
        };
    };
    return {
        dayOps,
        generateDays
    };
};